package com.spgf.controller;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.archtecture.model.exceptions.NegocioException;

public class ManutencaoActivity extends PadraoActivity {

	@Override
	protected void construirTela(Bundle savedInstanceState) throws NegocioException {
		setContentView(R.layout.activity_manutencao);

		((Button) findViewById(R.id.btn_manutencao_nova_categoria)).setOnClickListener(this);
		((Button) findViewById(R.id.btn_manutencao_visualizar_categorias)).setOnClickListener(this);

		((Button) findViewById(R.id.btn_manutencao_nova_despesa)).setOnClickListener(this);
		((Button) findViewById(R.id.btn_manutencao_visualizar_despesas)).setOnClickListener(this);

		((Button) findViewById(R.id.btn_manutencao_novo_orcamento)).setOnClickListener(this);
		((Button) findViewById(R.id.btn_manutencao_visualizar_orcamento)).setOnClickListener(this);

	}

	@Override
	protected void executarClick(View pView) throws NegocioException {
		if (pView.getId() == R.id.btn_manutencao_nova_categoria) {
			Intent lIntent = new Intent(this, CategoriaCadActivity.class);
			startActivity(lIntent);
		}

		else if (pView.getId() == R.id.btn_manutencao_visualizar_categorias) {
			Intent lIntent = new Intent(this, CategoriaMntActivity.class);
			startActivity(lIntent);
		}

		else if (pView.getId() == R.id.btn_manutencao_nova_despesa) {
			Intent lIntent = new Intent(this, DespesaCadActivity.class);
			startActivity(lIntent);
		}

		else if (pView.getId() == R.id.btn_manutencao_visualizar_despesas) {
			Intent lIntent = new Intent(this, DespesaMntActivity.class);
			startActivity(lIntent);
		}

		else if (pView.getId() == R.id.btn_manutencao_novo_orcamento) {
			Intent lIntent = new Intent(this, OrcamentoCadActivity.class);
			startActivity(lIntent);
		}

		else if (pView.getId() == R.id.btn_manutencao_visualizar_orcamento) {
			Intent lIntent = new Intent(this, OrcamentoMntActivity.class);
			startActivity(lIntent);
		}

	}
}
